package com.qcdp.utils;

import com.qcdp.service.impl.ShopServiceImpl;
import com.qcdp.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.function.Function;

@Component
public class TestFun {
    //根据传入id来查询我们的id的对应的数据

    @Autowired
    UserServiceImpl userService;

    @Autowired
    ShopServiceImpl shopService;

    public <R,ID>  R  getById(ID id, Class<R> type, Function<ID,R> fallBack){
        R apply = fallBack.apply(id);
        return apply;
    }
}
